package com.webmagic.demo.Instrument;

import us.codecraft.webmagic.Spider;

/**
 * @description
 * @Auther zhanglu
 * @Date 2018/4/17 上午1:28
 */
public class Start {
    public static void main(String[] args) {
        Spider spider =  Spider.create(new MvProcessor());
        spider.addUrl("http://www.instrument.com.cn/netshow/C13749.htm")
                .addPipeline(new SpiderService())
                //.addPipeline(new JsonFilePipeline("/Users/zhang.lu/Documents/instrument/"))
                .thread(1)
                .run();

        //抓取结束
        if (Spider.Status.Stopped.equals(spider.getStatus())){
            System.out.println("end!!!!!!!!!!!!");
        }
    }
}
